package com.tradeplus.admin.dao;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;

import com.tradeplus.admin.model.Country;

public class CountryDaoImpl implements CountryDao {
	
	private HibernateTemplate hibernateTemplate;

    public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
        this.hibernateTemplate = hibernateTemplate;
    }

	@Override
	public void saveCountry(Country country) {
		hibernateTemplate.merge(country);
		
	}

	@Override
	public List<Country> loadCountry() {
		return hibernateTemplate.find("from Country");
	}

	@Override
	public Country loadCountryById(Long countryId) {
		return (Country) hibernateTemplate.get(Country.class, countryId);
	}

	@Override
	public void deleteCountry(Long countryId) {
		// TODO Auto-generated method stub
		
	}

}
